package Aula14;

public class No{
	
	 	public No left;
	 	public No right;
	 	public No parent;
	 	public long key;
	
	public No(Long l){
		key = l;
	}

	public boolean hasLeft(){
		return getLeft() != null;
	}
	
	public boolean hasRight(){
		return getRight() != null;
	}
	
	public No getParent() {
		return parent;
	}

	public void setParent(No parent) {
		this.parent = parent;
	}

	public void setLeft(No left) {
		this.left = left;
	}

	public void setRight(No right) {
		this.right = right;
	}

	public long getKey() {
		return key;
	}

	public String toString() {
		return Long.toString(key);
	}

	public No getLeft() {
		return this.left;
	}

	public No getRight() {
		return this.right;
	}	
}
